package com.jetsum.micro.service;

//import io.seata.spring.annotation.GlobalTransactional;

import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class BusinessHandleServiceImpl implements BusinessHandleService {

    @Autowired
    private OrderService orderService;
    @Autowired
    private RepoService repoService;

    @Override
    @GlobalTransactional
    @Transactional(rollbackFor = Exception.class)
    public String business(int count) {
        orderService.save();
        repoService.adjust(count);
        return "success";
    }
}
